#ifndef HEAPAREA_H
#define HEAPAREA_H

#include <malloc.h>
#include "config/config_types.h"

namespace ssmt
{
	class HeapArea
	{
	public:
		HeapArea(size_t size)
		{
			start = (char*)malloc(size * sizeof(char));
			end = start + size;
			memory = size;
		}

		~HeapArea()
		{
			free(start);
		}
 
		void* getStart() const
		{ 
			PointerMagic pm;
			pm.as_char_ptr = start;
			return pm.as_void_ptr; 
		}

		void* getEnd() const
		{
			PointerMagic pm;
			pm.as_char_ptr = end;
			return pm.as_void_ptr; 
		}
 
	private:
		char* start;
		char* end;
		size_t memory;
	};
} //namespace ssmt

#endif HEAPAREA_H